// components/imgPlaceholder/imgPlaceholder.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    //占位图片类型 -- 指定大小用的
    /*
      list:240,240
      all:210,210
      detail:750,567
    */
    imgType: {
      type: String,
      value: "list"
    },
    imgUrl: {
      type: String,
      value: ""
    },

  },

  lifetimes: {
    attached: function () {
      // 在组件实例进入页面节点树时执行
      if (this.properties.imgType == "list" || this.properties.imgType == "all") {
        this.setData({
          showPlaPath: this.data.listPlaPath
        })
      }
      if (this.properties.imgType == "detail") {
        this.setData({
          showPlaPath: this.data.detailPlaPath
        })
      }


    },
    detached: function () {

    },
  },
  /**
   * 组件的初始数据
   */
  data: {
    listPlaPath: "/img/common/listplabg_icon.png",
    detailPlaPath: "https://jyhky.ylyc.top/bigplaimg_icon.png",
    showPlaPath: "",
    isLoadImg: false,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    imgBindLoadAction() {
      this.setData({
        isLoadImg: true
      })
    },
  }
})
